package com.aliang.book_java1.po.redis;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * redis·消息队列
 * ZTX
 */
// 消息订阅者
@Component
public class MessageSubscriber implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        String receivedMessage = message.toString();
        System.out.println("-----------收到消息----");
        System.out.println("Received message: " + receivedMessage);


    }
}
